﻿using System;

namespace Homework
{
    class Program
    {
        public static int SumNumber(int a)
        {
            int sum = 0;
            while (a != 0)
            {
                sum += a % 10;
                a = a / 10;
            }
            return sum;
        }

        static void Main()
        {
            Console.WriteLine(SumNumber(12345646));

        }
    }
}
